import instance from '../util/request'
// 文章分类
export const artGetChannelService = () => instance.get('/my/cate/list')

export const artAddChannelService = ({ cate_name, cate_alias }) =>
  instance.post('/my/cate/add', { cate_name, cate_alias })

export const artEditChannelService = (data) => instance.put('/my/cate/info', data)

export const artDelChannelService = ({ id }) => instance.delete('/my/cate/del', { params: { id } })

// 文章管理
export const artGetListService = (params) =>
  instance.get('/my/article/list', {
    params
  })
// 发布文章
export const artAddListService = (data) => instance.post('/my/article/add', data)
// 获取文章详情
export const artEditListService = (id) =>
  instance.get('/my/article/info', {
    params: { id }
  })

// 更新文章
export const artUpdateListService = (data) => instance.put('/my/article/info', data)

// 删除文章
export const artDelListService = (id) =>
  instance.delete('/my/article/info', {
    params: {
      id
    }
  })
